<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<a href="<?php echo U('Index/index');?>">返回首页</a>

<hr />

<form action="<?php echo ($action); ?>" class="form_style" name="add_cate_form" method="post">

<div class="form_item">
	<label>分类名称</label>
	<div class="form_item_main">
		<input type="text" name="cname" value="<?php echo ($obj["cname"]); ?>" />
        <input type="hidden" name="id" value="<?php echo ($obj["id"]); ?>"
	</div>
</div>
<div class="form_item">
	<label>排序</label>
	<div class="form_item_main">
		<input type="text" name="order" value="<?php echo ($obj["order"]); ?>" />
	</div>
</div>
<div class="form_item">
	<label>样式</label>
	<div class="form_item_main">
		<input type="text" name="cstyle" value="<?php echo ($obj["cstyle"]); ?>" />
	</div>
</div>





<div class="form_item">
	<label>上级目录</label>
	<div class="form_item_main">
		<select name="pid">
			<option value="0">无</option>
            <?php if(is_array($cateList)): $i = 0; $__LIST__ = $cateList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$cate): ++$i;$mod = ($i % 2 )?><option <?php if(($obj["pid"])  ==  $cate["id"]): ?>selected="selected"<?php endif; ?> value="<?php echo ($cate["id"]); ?>"><?php echo ($cate["cname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
		</select>
	</div>	
</div>
<div class="form_item">
	<div class="form_item_main">
		<input type="submit" value="保存" />
	</div>
</div>

</form>

<hr/>

<?php if(is_array($cateList)): $i = 0; $__LIST__ = $cateList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$editCate): ++$i;$mod = ($i % 2 )?><a href="<?php echo U('Cate/loadCateList?pid='.$editCate['id']);?>"><?php echo ($editCate["cname"]); ?></a>
 <a href="<?php echo U('Cate/delCate?id='.$editCate['id']);?>">删除</a>
 <a href="<?php echo U('Cate/editCate?id='.$editCate['id']);?>">编辑</a><br/><?php endforeach; endif; else: echo "" ;endif; ?>



<?php if(is_array($childCateList)): $i = 0; $__LIST__ = $childCateList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$childCate): ++$i;$mod = ($i % 2 )?><?php echo ($childCate["cname"]); ?>
<a href="<?php echo U('Cate/delCate?id='.$childCate['id'].'cateType=child');?>">删除</a>
<a href="<?php echo U('Cate/editCate?id='.$childCate['id']);?>">编辑</a><?php endforeach; endif; else: echo "" ;endif; ?>

</body>
</html>